package com.bigdata.service.controller.app;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.bigdata.common.annotation.Log;
import com.bigdata.common.annotation.RepeatSubmit;
import com.bigdata.common.core.controller.BaseController;
import com.bigdata.common.core.domain.PageQuery;
import com.bigdata.common.core.domain.R;
import com.bigdata.common.core.page.TableDataInfo;
import com.bigdata.common.core.validate.AddGroup;
import com.bigdata.common.core.validate.EditGroup;
import com.bigdata.common.enums.BusinessType;
import com.bigdata.common.utils.poi.ExcelUtil;
import com.bigdata.service.domain.bo.SearchHistoryBo;
import com.bigdata.service.domain.vo.SearchHistoryVo;
import com.bigdata.service.service.ISearchHistoryService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;

/**
 * 用户查询历史记录
 *
 * @author ruoyi
 * @date 2025-07-23
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/app/service/history")
public class AppSearchHistoryController extends BaseController {

    private final ISearchHistoryService iSearchHistoryService;

    /**
     * 查询用户查询历史记录列表
     */
    @PostMapping("/list")
    public TableDataInfo<SearchHistoryVo> list(@RequestBody SearchHistoryBo bo) {
        PageQuery pageQuery = new PageQuery();
        pageQuery.setPageNum(bo.getPageNum());
        pageQuery.setPageSize(bo.getPageSize());
        bo.setUserId(getUserId());
        return iSearchHistoryService.queryPageList(bo, pageQuery);
    }


}
